clear,clc
close all
load IA-GA.mat
trace1=trace;
load IA.mat
trace2=trace;
load GA.mat
trace3=trace;
load PSO-GA.mat
trace4=trace;
load IA-GA-greedy.mat
trace5=trace;
clr={'red', 'blue', 'black', 'magenta','green'};

figure,
hold on;
plot(trace1(:,1),'-','Color',clr{1})
plot(trace2(:,1),'--','Color',clr{2})
plot(trace3(:,1),':','Color',clr{3})
plot(trace4(:,1),'-.','Color',clr{4})
plot(trace5(:,1),'-','Color',clr{5})
xlabel('Iterations')
ylabel('Objective value')    
title('Total objective value changes')
legend('IA-GA','IA','GA','PSO-GA','IA-GA-greedy')

figure,
hold on;
plot(trace1(:,2),'-','Color',clr{1})
plot(trace2(:,2),'--','Color',clr{2})
plot(trace3(:,2),':','Color',clr{3})
plot(trace4(:,2),'-.','Color',clr{4})
plot(trace5(:,2),'-','Color',clr{5})
xlabel('Iterations')
ylabel('Objective 1 value')  
title('Task time deviation changes')
legend('IA-GA','IA','GA','PSO-GA','IA-GA-greedy')

figure,
hold on;
plot(trace1(:,3),'-','Color',clr{1})
plot(trace2(:,3),'--','Color',clr{2})
plot(trace3(:,3),':','Color',clr{3})
plot(trace4(:,3),'-.','Color',clr{4})
plot(trace5(:,3),'-','Color',clr{5})
xlabel('Iterations')
ylabel('Objective 2 value')  
title('Task completion time changes')
legend('IA-GA','IA','GA','PSO-GA','IA-GA-greedy')

figure,
hold on;
plot(trace1(:,4),'-','Color',clr{1})
plot(trace2(:,4),'--','Color',clr{2})
plot(trace3(:,4),':','Color',clr{3})
plot(trace4(:,4),'-.','Color',clr{4})
plot(trace5(:,4),'-','Color',clr{5})
xlabel('Iterations')
ylabel('Objective 3 value')  
title('Total cost time of USVs changes')
legend('IA-GA','IA','GA','PSO-GA','IA-GA-greedy')